package 装饰模式.商场促销实例;

/**
 * @author zyl
 * @Description
 * @since 2023/12/26 10:44
 */

public  class CashSuper implements ISale{

    protected ISale iSale;

    //装饰
    public void decorate(ISale iSale){
        this.iSale = iSale;
    }

    @Override
    public double acceptCash(double price, int num) {
        double result = 0d;
        if (this.iSale != null){
            result = this.iSale.acceptCash(price,num);
        }
        return result;
    }
}
